home *** CD-ROM | disk | FTP | other *** search
- on skrivHost
- play frame "sendHost"
- end
-
- on skrivChat
- play frame "sendChat"
- end
-
- on skrivGame
- play frame "sendGame"
- end
-
- on checkOut
- play frame "loggaAv"
- end
-
- on nyttSpel
- play frame "newGame"
- end
-
- on readOpponents
- global gFileList, gPulledLength, gOppPull, gHost, gHit, gPulledOff, gOppName, gReleased, gForlust, gPaperLeft
- readFile()
- if count(gFileList) = 0 then
- set whatIWant to -1
- else
- set msgID to EMPTY
- set msgType to EMPTY
- set tabs to 0
- set data to getAt(gFileList, 1)
- deleteAt(gFileList, 1)
- repeat with i = 1 to length(data)
- if char i of data = TAB then
- set tabs to tabs + 1
- end if
- if tabs = 4 then
- put char i + 1 of data after msgID
- end if
- if tabs = 5 then
- put char i + 1 of data after msgType
- end if
- if tabs = 7 then
- exit repeat
- end if
- end repeat
- set msgID to value(chars(msgID, 1, length(msgID) - 1))
- set msgType to value(chars(msgType, 1, length(msgType) - 1))
- set chatData to chars(data, i + 1, length(data) - 1)
- set data to value(chars(data, i + 1, length(data) - 1))
- if (msgType > 9) or (msgType < 0) then
- set whatIWant to -1
- else
- if msgID = 2 then
- set gPulledOff to getAt(data, 1)
- set gHit to getAt(data, 2)
- set gReleased to getAt(data, 3)
- set gOppPull to getAt(data, 4)
- set gPulledLength to getAt(data, 5)
- set gForlust to getAt(data, 6)
- set gPaperLeft to getAt(data, 7)
- set whatIWant to msgID
- else
- if msgID = 1 then
- doChat(string(chatData))
- set whatIWant to msgID
- else
- if msgID = 3 then
- if gHost = 0 then
- set gPaperLeft to data
- end if
- set whatIWant to msgID
- else
- if msgID = 6 then
- set data to gOppName & " has quit the game!"
- doChat(data)
- set whatIWant to msgID
- end if
- end if
- end if
- end if
- end if
- end if
- return whatIWant
- end
-